Skip to content

feat(lance): add Lance REST server packaging#8825

Merged
jerryshao merged 7 commits intoapache:branch-lance-namepspace-devfrom
beinan:beinan/lance_catalog
Oct 21, 2025
Merged

feat(lance): add Lance REST server packaging#8825
jerryshao merged 7 commits intoapache:branch-lance-namepspace-devfrom
beinan:beinan/lance_catalog

Conversation

@beinan
Copy link
Copy Markdown

@beinan beinan commented Oct 17, 2025

What changes were proposed in this pull request?

  • add the new lance-common and lance-rest-server modules that bootstrap a minimal Lance catalog REST facade backed by in-memory state
  • introduce REST resources (LanceCatalogOperations, LanceMetadataOperations) plus a GravitinoLanceRESTServer entry point and auxiliary service wiring
  • package assets for the Lance REST server (config + startup script) and hook the module into Gradle distribution/standalone tarball tasks with checksums
  • extend build dependencies (SLF4J, Dropwizard metrics, Prometheus bridge) so the service runs using existing Gravitino telemetry components
  • surface scaffolding build.gradle.kts under lance/ to disable blanket task execution and ensure module resolution

Why are the changes needed?

  • the Lance integration needs a thin REST façade to iterate on metadata APIs before the backend is available; this scaffolding mirrors the Iceberg REST
    flow
  • distribution packaging must include the new service so it can be assembled, tested, and deployed alongside other Gravitino auxiliaries

Fix: #N/A

Does this PR introduce any user-facing change?

  • new Lance REST server tarball and config/script templates shipped with the distribution
  • new REST endpoints under /lance/v1/... exposing catalog metadata (namespaces, tables)
  • no breaking changes to existing services

How was this patch tested?

@jerryshao
Copy link
Copy Markdown
Contributor

jerryshao commented Oct 17, 2025

Hi @beinan I created a new branch for Lance development. Can you please create a PR against that branch (https://github.com/apache/gravitino/tree/dev-lance-namespace)?

@beinan beinan changed the base branch from main to dev-lance-namespace October 17, 2025 05:56
@beinan
Copy link
Copy Markdown
Author

beinan commented Oct 17, 2025

Hi @beinan I created a new branch for Lance development. Can you please create a PR against that branch (https://github.com/apache/gravitino/tree/dev-lance-namespace)?

Yes, I made the PR against the new branch now

@beinan beinan force-pushed the beinan/lance_catalog branch from c753cb1 to ea7a30d Compare October 17, 2025 06:10
@jerryshao
Copy link
Copy Markdown
Contributor

Hi @beinan , The branch setting has some limitations; only the branch name started with "branch-" will run the CI, so I created a new branch (https://github.com/apache/gravitino/tree/branch-lance-namepspace-dev). Can you refresh you PR against new branch?

@beinan beinan changed the base branch from dev-lance-namespace to branch-lance-namepspace-dev October 17, 2025 06:21
@jerryshao jerryshao closed this Oct 17, 2025
@jerryshao jerryshao reopened this Oct 17, 2025
@beinan beinan changed the title feat(lance): add Lance REST server packaging (#0) feat(lance): add Lance REST server packaging Oct 17, 2025
@beinan beinan force-pushed the beinan/lance_catalog branch from 43b13eb to e91ccb9 Compare October 18, 2025 07:18
@beinan
Copy link
Copy Markdown
Author

beinan commented Oct 18, 2025

@jerryshao could you help approve the CI? thanks

@beinan
Copy link
Copy Markdown
Author

beinan commented Oct 19, 2025

Hey @jerryshao, could you help enable me to start the CI?

@yuqi1129
Copy link
Copy Markdown
Contributor

We need to cherry-pick @diqiu50fix about CI to branch-lance-namepspace.

@jerryshao
Copy link
Copy Markdown
Contributor

We need to cherry-pick @diqiu50fix about CI to branch-lance-namepspace.

Let me rebase that branch.

### What changes were proposed in this pull request?

can specify a principal and authorizer to do authz

### Why are the changes needed?

polish authz codes for easier reuse

### Does this PR introduce _any_ user-facing change?

no

### How was this patch tested?

tests updated
@Path("/{id}/list")
public Response listNamespaces(
@Encoded @PathParam("id") String namespaceId,
@DefaultValue(".") @QueryParam("delimiter") String delimiter,
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The Lance namespace spec uses $ as the default delimiter.

Ref: https://lancedb.github.io/lance/format/namespace/concepts/#object-name

Image

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good call, changed to $

…ity cache is full. (apache#8816)

### What changes were proposed in this pull request?

Adjust the caffeine weight for tags and policies to allow them to evict
first compared to other entities.

### Why are the changes needed?

They are less important than entities like tables, filesets.

Fix: apache#8815 

### Does this PR introduce _any_ user-facing change?

N/A.

### How was this patch tested?

UTs

---------

Co-authored-by: Jerry Shao <jerryshao@datastrato.com>
public static final ConfigEntry<String> CATALOG_NAME =
new ConfigBuilder(LANCE_CONFIG_PREFIX + "catalog-name")
.doc("Logical Lance catalog served by the REST endpoint")
.version(ConfigConstants.VERSION_0_1_0)
Copy link
Copy Markdown
Contributor

@yuqi1129 yuqi1129 Oct 20, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will Lance rest plan to use a separate version management system, and the version starts from 0.1.0?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't have strong preference, what do you think?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

iceberg rest service is using 0.2.0

  public static final ConfigEntry<String> CATALOG_BACKEND =
      new ConfigBuilder(IcebergConstants.CATALOG_BACKEND)
          .doc("Catalog backend of Gravitino Iceberg catalog")
          .version(ConfigConstants.VERSION_0_2_0)
          .stringConf()
          .createWithDefault("memory");

@beinan beinan force-pushed the beinan/lance_catalog branch from 098dfaa to 763281b Compare October 21, 2025 03:08
Copy link
Copy Markdown
Contributor

@mchades mchades left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm. @jerryshao Would you like to take another review?

@jerryshao
Copy link
Copy Markdown
Contributor

Let's merge it first for the quick iteration.

@jerryshao jerryshao merged commit eb8ace8 into apache:branch-lance-namepspace-dev Oct 21, 2025
28 checks passed
jerryshao added a commit to jerryshao/gravitino that referenced this pull request Nov 11, 2025
### What changes were proposed in this pull request?

- add the new lance-common and lance-rest-server modules that bootstrap
a minimal Lance catalog REST facade backed by in-memory state
- introduce REST resources (LanceCatalogOperations,
LanceMetadataOperations) plus a GravitinoLanceRESTServer entry point and
auxiliary service wiring
- package assets for the Lance REST server (config + startup script) and
hook the module into Gradle distribution/standalone tarball tasks with
checksums
- extend build dependencies (SLF4J, Dropwizard metrics, Prometheus
bridge) so the service runs using existing Gravitino telemetry
components
- surface scaffolding build.gradle.kts under lance/ to disable blanket
task execution and ensure module resolution

  ### Why are the changes needed?

- the Lance integration needs a thin REST façade to iterate on metadata
APIs before the backend is available; this scaffolding mirrors the
Iceberg REST
    flow
- distribution packaging must include the new service so it can be
assembled, tested, and deployed alongside other Gravitino auxiliaries

  Fix: #N/A

  ### Does this PR introduce any user-facing change?

- new Lance REST server tarball and config/script templates shipped with
the distribution
- new REST endpoints under /lance/v1/... exposing catalog metadata
(namespaces, tables)
  - no breaking changes to existing services

  ### How was this patch tested?

  - ./gradlew :lance:lance-rest-server:build
- started the service locally with java -cp
lance/lance-rest-server/build/libs/* ...GravitinoLanceRESTServer
/tmp/gravitino-lance-rest-server.conf
  - curl http://127.0.0.1:9101/lance/v1/catalog
  - curl http://127.0.0.1:9101/lance/v1/catalog/namespaces
- curl
"http://127.0.0.1:9101/lance/v1/metadata/table?namespace=default&name=sample_table"
- curl -X POST http://127.0.0.1:9101/lance/v1/catalog/namespaces -H
'Content-Type: application/json' -d '{"namespace":"demo"}'
- curl -X DELETE http://127.0.0.1:9101/lance/v1/catalog/namespaces/demo

---------

Co-authored-by: mchades <liminghuang@datastrato.com>
Co-authored-by: Mini Yu <yuqi@datastrato.com>
Co-authored-by: Jerry Shao <jerryshao@datastrato.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants